<!--
 * @Author: early-autumn
 * @Date: 2020-05-13 11:19:27
 * @LastEditors: early-autumn
 * @LastEditTime: 2020-05-28 09:18:41
 -->
<template>
  <div>
    <div
      v-for="phone in phones"
      :key="phone.phoneNumber"
      @click="$emit('click', phone)"
    >
      <el-row v-if="phone.phoneNumber.trim()">
        <el-col :span="16">{{ phone.phoneNumber }}</el-col>
        <el-col :span="8">
          <el-tag size="mini">{{
            phoneOwnershipEnum[phone.phoneOwnership]
          }}</el-tag>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script>
import { phoneOwnershipEnum } from '@/utils/enums'

export default {
  name: 'TablePhone',
  props: {
    phones: {
      type: Array,
      default: () => [],
    },
  },
  computed: {
    phoneOwnershipEnum() {
      return phoneOwnershipEnum
    },
  },
}
</script>
